﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TamTreSoSinh.DBContext;

namespace TamTreSoSinh.UC
{
    public partial class GalleryPart : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadData();
        }

        private void LoadData()
        {
            DBTamTreEntities dbContext = new DBTamTreEntities();
            List<GalleryImage> listGalleryImage = dbContext.GalleryImages.Where(obj => obj.IsOnHomePage).OrderBy(obj => obj.Priority).ToList();
        }

        protected void rptGallery_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            GalleryImage galleryImage = (GalleryImage)e.Item.DataItem;
            HyperLink hpl = (HyperLink)e.Item.FindControl("hplImage");
            
            //hpl.NavigateUrl = galleryImage.ImagePath;
            //hpl.ImageUrl = galleryImage.ImagePath;
        }
    }
}